<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?>

<?php
$attributes = array(
    'class' => 'control-label',
);
?>
<div class="span9">

    <?php $causa = $this->session->userdata('causa'); ?>
    <div class="breadcrumb">
        <h4 style="margin: 0px;"><?php echo $causa['caratula'] . ' - ' . $causa['nroExpediente']; ?></h4>
    </div>

    <?php echo get_message(); ?>
    <h2><?php echo $titulo; ?></h2>

    <h3>Buscar Por:</h3>

    <?php echo form_open(); ?>

    <div class="row-fluid">
        <div class="span2">
            <div class="control-group">
                <?php echo form_label('Matrícula', 'matricula', $attributes); ?>
                <div class="controls">
                    <?php echo form_input(array('class' => 'span11', 'name' => 'matricula', 'type' => 'text')); ?>
                </div>
            </div>
        </div>
        <div class="span2">
            <div class="control-group">
                <?php echo form_label('Documento', 'numeroDoc', $attributes); ?>
                <div class="controls">
                    <?php echo form_input(array('class' => 'span11', 'name' => 'numeroDoc', 'type' => 'text')); ?>
                </div>
            </div>
        </div>
        <div class="span2">
            <div class="control-group">
                <?php echo form_label('Nombre', 'nombre', $attributes); ?>
                <div class="controls">
                    <?php echo form_input(array('class' => 'span11', 'name' => 'nombre', 'type' => 'text')); ?>
                </div>
            </div>
        </div>
        <div class="span2">
            <div class="clearfix" style="height: 25px;"></div>
            <div class="control-group">
                <div class="controls">
                    <?php echo form_input(array('class' => 'span11', 'name' => 'submit', 'type' => 'submit', 'value' => 'Buscar', 'class' => 'btn')); ?>
                </div>
            </div>
        </div>
    </div>

    <?php echo form_close(); ?>

    <div class="clearfix"></div>

    <?php if (!empty($medicos)) { ?>
        <div class="container-table">
            <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-hover table-bordered">
                <thead>
                    <tr>
                        <th>Matrícula</th>
                        <th>Nombre</th>
                        <th>Acciones</th>
                    </tr>
                </thead>
                <tbody>
                    <?php
                    $color = 'odd';
                    foreach ($medicos as $medico) {
                        if (!in_array($medico->matricula, $demandados_agregados)) {
                            $color = ( $color == 'odd') ? 'even' : 'odd';
                            ?>

                            <tr class="<?php echo $color; ?>">
                                <td><?php echo $medico->matricula; ?></td>
                                <td><?php echo $medico->nombre; ?></td>
                                <td>
                                    <a class="btn btn-small" href="<?php echo base_url('causas/intervinientes/nuevo_demandado_medico/' . $medico->matricula); ?>"><span class="icon-plus-sign"></span> Agregar</a>
                                </td>
                            </tr>
                            <?php
                        }
                    }
                    ?>
                </tbody>
            </table>
        </div>
    <?php } ?>
</div>

<?php echo form_hidden('url', ''); ?>